import {
  addDep,
  officeListUrl,
  swipe,
  doctorList,
  visitor,
  registerUrl,
  dutyDoctor,
  visInsert
} from "@/config/url";

import axios from "./http";

//此处调用封装的 axios 进行具体的数据请求
export const getDepList = () => {
  const result = axios.get(officeListUrl);
  return result;
};

// 获取轮播图
export const getSwipe = () => {
  const res = axios.get(swipe);
  return res;
};

// 根据父科室ID获取子科室
export const getDerivedDepList = (depid: any) => {
  const result = axios.post(officeListUrl, { depid });
  return result;
};

// 获取 病人登录
export const login = (data: any) => {
  const res = axios.post(visitor, data);
  return res;
};

// 获取病人信息
export const getUserInfo = (id: number) => {
  const res = axios.get(`/user/${id}`);
  return res;
};
// 获取 医生数据
export const getDoctorList = () => {
  const result = axios.get(doctorList);
  return result;
};
// 获取 医生数据
export const getDoctor = () => {
  const res = axios.get(doctorList);
  return res;
};

// 发送 病人注册信息
export const getRegister = (data: any) => {
  const result = axios.post(registerUrl, { data });
  return result;
};

// 获取值班医生数据
export const getDutyDoctor = () => {
  const res = axios.get(dutyDoctor);
  return res;
};


// export const insertDepList = () => {
//     const result = axios.post(addDep, {
//         name: ["妇科","儿科"]
//     })
//     return result
// }

// 查询子科室
// export const DepList = (fukeshi) => {
//     const result = axios.post(officeListUrl, {
//         depid: fukeshi
//     })
// }
